#ifndef __PR2000_CEQFUNC_H__
#define __PR2000_CEQFUNC_H__

#include "pr2000_support.h"
#include "pr2000_table.h"

//////////////////////////////////// CEQ Table /////////////////////////////////////////////
/* 
 * 0x13 = (comp distance>1200)?(From estComplex):(From estAtten2)
 * 0x11 = From vadc. 
 */
#define MAX_PR2000_CEQ_VADC_TBL_NUM (20)
#define MAX_PR2000_CEQ_COMP_TBL_NUM (20)
#define MAX_PR2000_CEQ_ATTEN_TBL_NUM (12)
/* vadcH(dcgain>0x2E00), vadcL(dcgain<=0x2E00), CVI->[gfit(1x01_gainfit) | ygan(1x28_y_out_gain)] */
extern const _stPR2000_Table_CEQ_VADC pr2000_ceq_table_vadc[MAX_PR2000_CEQ_VADC_TBL_NUM];/*}}}*/

extern const _stPR2000_Table_CEQ_SDResolution pr2000_ceq_table_estComplex_SD[MAX_PR2000_CEQ_COMP_TBL_NUM];/*}}}*/
extern const _stPR2000_Table_CEQ_SDResolution pr2000_ceq_table_estAtten2_SD[MAX_PR2000_CEQ_ATTEN_TBL_NUM];/*}}}*/

#if defined(SUPPORT_STD_PVI)
extern const _stPR2000_Table_CEQ_STD_HDResolution pr2000_ceq_std_table_estComplex_PVI[MAX_PR2000_CEQ_COMP_TBL_NUM];/*}}}*/
extern const _stPR2000_Table_CEQ_STD_HDResolution pr2000_ceq_std_table_estAtten2_PVI[MAX_PR2000_CEQ_ATTEN_TBL_NUM];/*}}}*/
#endif //defined(SUPPORT_STD_PVI)

#if defined(SUPPORT_STD_HDA)
extern const _stPR2000_Table_CEQ_STD_HDResolution pr2000_ceq_std_table_estComplex_HDA[MAX_PR2000_CEQ_COMP_TBL_NUM];/*}}}*/
extern const _stPR2000_Table_CEQ_STD_HDResolution pr2000_ceq_std_table_estAtten2_HDA[MAX_PR2000_CEQ_ATTEN_TBL_NUM];/*}}}*/
#endif //defined(SUPPORT_STD_HDA)

#if defined(SUPPORT_STD_CVI)
extern const _stPR2000_Table_CEQ_STD_HDResolution pr2000_ceq_std_table_estComplex_CVI[MAX_PR2000_CEQ_COMP_TBL_NUM];/*}}}*/
extern const _stPR2000_Table_CEQ_STD_HDResolution pr2000_ceq_std_table_estAtten2_CVI[MAX_PR2000_CEQ_ATTEN_TBL_NUM];/*}}}*/
#endif //defined(SUPPORT_STD_CVI)

#if defined(SUPPORT_STD_HDT)
extern const _stPR2000_Table_CEQ_STD_HDResolution pr2000_ceq_std_table_estComplex_HDT_OLD[MAX_PR2000_CEQ_COMP_TBL_NUM];/*}}}*/
extern const _stPR2000_Table_CEQ_STD_HDResolution pr2000_ceq_std_table_estAtten2_HDT_OLD[MAX_PR2000_CEQ_ATTEN_TBL_NUM];/*}}}*/

extern const _stPR2000_Table_CEQ_STD_HDResolution pr2000_ceq_std_table_estComplex_HDT_NEW[MAX_PR2000_CEQ_COMP_TBL_NUM];/*}}}*/
extern const _stPR2000_Table_CEQ_STD_HDResolution pr2000_ceq_std_table_estAtten2_HDT_NEW[MAX_PR2000_CEQ_ATTEN_TBL_NUM];/*}}}*/
#endif //defined(SUPPORT_STD_HDT)

////////////////////////////////////////////////////////////////////////////////////////////



#ifdef SUPPORT_CEQ
int PR2000_GetDetGainStatus(const int i2cFd, const uint8_t slvAddr, _stPR2000_DetGainStatus *pstDetGainStatus);
int PR2000_GetEQGain(const int i2cFd, const uint8_t slvAddr, _stPR2000_VidStatusReg *pstVidStatusReg, const _stPR2000_DetGainStatus *pstDetGainStatus, _stPR2000_MeasureEqInfo *pstMeasureEqInfo);
int PR2000_SetEQGain(const int i2cFd, const uint8_t slvAddr, _stPR2000_VidStatusReg *pstVidStatusReg, const _stPR2000_DetGainStatus *pstDetGainStatus, _stPR2000_MeasureEqInfo *pstMeasureEqInfo);
int PR2000_GetTunnEQGain(const int i2cFd, const uint8_t slvAddr, _stPR2000_VidStatusReg *pstVidStatusReg, const _stPR2000_DetGainStatus *pstDetGainStatus, const _stPR2000_TunnFactor *pstTunnFactor, _stPR2000_MeasureEqInfo *pstMeasureEqInfo);
int PR2000_SetVADCGain(const int i2cFd, const uint8_t slvAddr, _stPR2000_VidStatusReg *pstVidStatusReg, const _stPR2000_DetGainStatus *pstDetGainStatus, _stPR2000_MeasureEqInfo *pstMeasureEqInfo);
int PR2000_SetTunnVADCGain(const int i2cFd, const uint8_t slvAddr, _stPR2000_VidStatusReg *pstVidStatusReg, const _stPR2000_DetGainStatus *pstDetGainStatus, _stPR2000_TunnFactor *pstTunnFactor, _stPR2000_MeasureEqInfo *pstMeasureEqInfo);
int PR2000_SetTunnEQBand(const int i2cFd, const uint8_t slvAddr, _stPR2000_VidStatusReg *pstVidStatusReg, const _stPR2000_DetGainStatus *pstDetGainStatus, _stPR2000_TunnFactor *pstTunnFactor,_stPR2000_MeasureEqInfo *pstMeasureEqInfo);
#endif //SUPPORT_CEQ
int PR2000_SetTblBrief(const int i2cFd, const uint8_t slvAddr, const enum _eCameraStandard cameraStandard, const enum _eVideoResolution videoResolution,const uint8_t regMode, _stJobProc*pstJobProc);

int PR2000_ProcessCameraPlugIn(const int i2cFd, const uint8_t slvAddr, void *pArg);
int PR2000_ProcessCameraMonitor(const int i2cFd, const uint8_t slvAddr, enum _eBitIrq bitIrq, void *pArg);

#endif // __PR2000_CEQFUNC_H__
